/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
 * TrainingBook
 * Copyright (C) Arnaud Duval 2010 <arnaud.duval@gmail.com>
 * 
 * TrainingBook is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * TrainingBook is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef _DATE_TIME_ENTRY_HPP_
#define _DATE_TIME_ENTRY_HPP_

#include <DateTime.hpp>
#include <gtkmm.h>

///@class DateTimeEntry
///@brief A GUI entry zone for DateTime values
class DateTimeEntry: public Gtk::Entry 
{
	public:
		DateTimeEntry();	//Default constructor
		virtual ~DateTimeEntry();   //Destructor
		void SetPrintFormat(std::string);   //Set the print format
		void SetValue(DateTime);	//Set the entry value
		void UpdateDisplay();	   //Update the displayed value
		DateTime GetValue();		//Return the value

	protected:
		///@brief Update the value when the content of the entry is changed
		virtual void on_changed();
	private:
		DateTime value; //Value for the entry
		std::string format;	//Print format

};

#endif // _DATE_TIME_ENTRY_HPP_
